package com.thd.springboottest.ioc.profile;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
public class RegistBeanByAnnotationProfileAndConfiguration {

    // 当application.yml中配置的spring.profiles.active配置的值是prod或test时才会注册下面的bean
    @Bean
    @Profile(value={"prod","test"})
    public RegistBeana registBeana(){
        return new RegistBeana();
    }

}
